The present invention relates to a control device applicable to flash memory cards and, more particularly, to a control device compatible to Smart Media cards, Memory Stick cards, and NAND-gate type flash memories and applicable to various kinds of capacities and a method for building partial lookup table.
Along with continual progress of the information industry, high-speed data storage devices (memories) play very important roles due to influence of ever faster CPUs and development of information appliance (IA) products.
As shown in FIG. 1A, a data storage device (e.g., a Smart Media card, a Memory Stick card, or a NAND-gate type flash memory) 11 is connected to a host computer 29 mainly via a control device 20. Of course, the control device 20 can also be built in a subsystem of the host computer 29. The control device 20 comprises a microprocessor 25 therein, which can be connected to the host computer 29 via an interface controller 24 conforming to the protocol of PCMCIA, IDE, ATA, ATAPI, USB, or their combination. One end of the microprocessor 25 can be connected to the data storage device 11 via a storage control logic circuit 26. The microprocessor 25 can also be connected to a buffer controller 22. The buffer controller 22 can temporarily store the data to be accessed by the host computer 29 into a data storage region 21 (a first buffer 211, a second buffer 213, and an N-th buffer 219). Additionally, an ECC logic circuit 23 conforming to the standard of Smart Media is respectively connected to the microprocessor 25, the buffer controller 22, and the storage control logic circuit 26. The ECC logic circuit 22 is controlled by the microprocessor 25 to give a corresponding error-correcting code (ECC) data to a data sector to be accessed. Certainly, the ECC logic circuit 23 is not required if only applied to Memory Stick cards, but a design conforming to serial circuits and CRC of Memory Stick is required. Moreover, the microprocessor 25 can be connected to a lookup table 255, which can be used to keep logic block addresses (L0xcx9cLk-1) and all physical block address (PBA) values of the corresponding data storage device 11.
Please refer to FIG. 1 and FIG. 2 is a diagram with the block as a link unit. DATA and ECC only represent general stored data and the accessory ECC data thereof instead of only a piece of data stored therein. In fact, a block comprises 16 or 32 sectors of data and 16 or 32 sets of ECC data. L represents the data stored in an adjunct region of a block. The data thereof is a pointer built when the system is initiating. When the host computer 29 or the control device 20 is turned on, the microprocessor 25 in the control device 20 will control a scan program to scan all physical blocks (B0xcx9cBn-1) in the memory card 11 to obtain corresponding logic block address data (LBA; L0xcx9cLk-1) of the physical blocks (B0xcx9cBn-1, where k is a little smaller than n). The microprocessor 25 then immediately builds these relations in a lookup table 255. In other words, the microprocessor 25 will fill the corresponding physical block addresses (Some block in B0xcx9cBn-1, n-k blocks, reserved by system are not mapped with mapping table) of data in the logical block addresses (L0xcx9cLk-1) to build a complete mapping relationship. Therefore, when the host computer 29 is to access a file, it can quickly find the corresponding physical block (B0xcx9cBn) wherein the file is stored to access data.
However, the conventional control device of flash memory cards and the method for fabricating same have the following drawbacks.
1. Data storage devices such as Smart Media cards, Memory Stick cards, or NAND-gate type flash memories utilize a block as a basic unit for erasing or storing data. Along with increase of memory capacity, the number of blocks increases accordingly, but the memory capacity of the lookup table is finite. Therefore, an old data storage device will be not compatible to a new data storage device having a higher capacity because that the new memory card needs a lookup table of a larger capacity.
2. If it is necessary to match flash memory cards of high capacity, the static RAM (random access memory) designed in the control device for storing data of the lookup table needs to choose a higher capacity, hence relatively increasing the cost.
3. When the host computer accesses a file, the control device will search the corresponding data blocks in the whole lookup table to perform access of data. Generally speaking, however, the data blocks corresponding to the file exist in adjacent sectors. Therefore, the operation will waste time and usage ratio of memory capacity of the lookup table.
4. When the host computer accesses a file, the read frequency of system data such as the partition table, the BIOS parameter block (BPB), and the FAT (File allocation table) is higher than that of general files. The capacity of these system data is not large, but it is necessary to search the whole lookup table when reading these system data or the file data each time due to specification limit of the conventional flash memory card, hence lengthening operation time and lowering operation speed.
Accordingly, the present invention aims to propose a novel control device of flash memory cards to resolve the problems in the prior art. The present invention not only can be compatible and applicable to flash memory cards or NAND-gate type flash memories of various kinds of capacities, but also can increase usage ratio of memory of the lookup table and shorten the search time of physical blocks.
The primary object of the present invention is to provide a control device applicable to flash memory cards and a method for building partial lookup table, wherein a storage memory of a fixed capacity of a lookup table can be applicable and compatible to flash memory cards or NAND-gate type flash memories of various kinds of capacities, thereby achieving unlimited expansion and enhancement of compatibility.
The secondary object of the present invention is to provide a control device applicable to flash memory cards and a method for building partial lookup table, wherein a storage memory of a smaller capacity of a lookup table is utilized to match flash memories of various kinds of specification, thereby controlling the cost.
Another object of the present invention is to provide a control device applicable to flash memory cards and a method for building partial lookup table, wherein a segment lookup table and a FAT accessory lookup table are matched and utilized to relatively enhance operation speed and reduce operation time.
Yet another object of the present invention is to provide a control device applicable to flash memory cards and a method for building partial lookup table, wherein a segment lookup table and a FAT accessory lookup table are matched and utilized to save operation time of the system and relatively enhance usage ratio of memory of the lookup table.
The various objects and advantages of the present invention will be more readily understood from the following detailed description when read in conjunction with the appended drawing, in which: